﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Dubbo.Rpc
{
    public interface IInvoker
    {
        /**
         * get url.
         * 
         * @return url.
         */
        URL Url { get; }

        /**
         * is available.
         * 
         * @return available.
         */
        bool IsAvailable { get; }

        /**
         * destroy.
         */
        void Destroy();
    }

    public interface IInvoker<T> : IInvoker
    {
        /**
         * invoke.
         * 
         * @param invocation
         * @return result
         * @throws RpcException
         */
        IResult Invoke(IInvocation<T> invocation);

    }
}
